<?php
/**
 * Subcategoryadmin_Model_Insertsubcategory
 * insert sub category
 * @author Adrian Stolarski
 */
class Subcategoryadmin_Model_Insertsubcategory implements Subcategoryadmin_Model_Mainable {
    
    /**
     *
     * @var type $action_helper
     * action helper
     */
    public $action_helper;
    
    /**
     * main()
     * insert new sub category
     * 
     * @param array $variables
     */
    public function main(array $variables = null) {
        if(isset($variables['csrf_token']) && ($variables['csrf_token'] == $_SESSION['csrf_token'])){
            $this->action_helper = new Subcategoryadmin_Data_Insertsubcategory;
            $this->action_helper->main($variables);
        }
        else {
            session_destroy();
            $this->action_helper = new Login_Data_Loginredirect;
            $this->action_helper->main($variables);
        }
    }

}
